package com.yc.cinema;

import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class Computer {

    // @Resource java 提供, 默认 byName 方式注入对象
    @Resource
    private Storage usb;
    @Resource(name="hd")
    private Storage hardDisk;

    public Storage getUsb() {
        return usb;
    }

    public void setUsb(Storage usb) {
        this.usb = usb;
    }

    public Storage getHardDisk() {
        return hardDisk;
    }

    public void setHardDisk(Storage hardDisk) {
        this.hardDisk = hardDisk;
    }
}
